1. Field of the Invention
The present invention relates to an ellipse filling graphics method, and more particularly, to a method for filling the interior of an ellipse with a single color by writing predetermined color data to memory positions corresponding to pixels in the ellipse being a basic graphics figure.
2. Description of Related Art
In general, graphic displays are used in a wide range of fields, for example, the graphic user interface of computers. When an object is expressed in such fields, it is divided into dots, lines, triangles, rectangles, circles or ellipses. Circles and ellipses in particular require extensive processing time. In addition, it takes a lot of time to fill the interiors of the circle and the ellipse with a color.
FIG. 1 shows a conventional circle filling method. It is assumed for convenience's sake that the center of the circle in FIG. 1 is at the origin (0,0) of a coordinate system. First, when the circumference of the circle is divided by 8, a point (x,y) on a first octant is obtained by moving one pixel at a time from a point (0,r) to a point where x is equal to y, using a well-known midpoint circle algorithm. Points (-x,y), (y,x), (-y,x), (y,-x), (-y,-x), (x,-y), and (-x,-y) are calculated from the point (x,y) on the first octant. Then, the points in positions symmetrical with respect to the y axis are connected to each other by straight lines, whereby the circle is filled. That is, each pair of the points (x,y) and (-x,y), (y,x) and (-y,x), (y,-x) and (-y,-x), and (x,-y) and (-x,-y) are connected to each other by a straight line. This procedure repeats from the point (0,r) to the point where x is equal to y.
An ellipse case corresponds to an extension of the circle case. FIG. 2 shows a conventional ellipse filling method. The circumference of an ellipse is divided into four quadrants to utilize the symmetry of ellipses. It is assumed for convenience's sake that the origin of the ellipse in FIG. 2 is at a point (0,0) as in the case of FIG. 1. When half the major axis of the ellipse (hereinafter referred to as the long radius of the ellipse) is a and half the minor axis of the ellipse (hereinafter referred to as the short radius thereof) is b, a point (x,y) on the circumference of the first quadrant is obtained by moving one pixel at a time from a point (0,b) to a point (a,0). Points (-x,y), (x,-y) and (-x,-y) are obtained from the point (x,y). The points (x,y) and (-x,y) are connected to each other by a straight line, and likewise for the points (x,-y) and (-x,-y). This procedure repeats between the points (0,b) and (a,0).
However, in the method of drawing a circle or an ellipse, the interiors of the circle and the ellipse are filled by drawing 2r and 2b straight lines, respectively, which requires a lot of processing time.